<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"/>
    <title>Layui公共模版（Thymeleaf模板）</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

</head>
<body>
    <!-- 导航图标 -->
    <th:block th:fragment="favicon">
        <!-- 标准 Favicon（适用于所有浏览器） -->
        <link rel="icon" type="image/x-icon" th:href="@{/images/favicon.ico}">

        <!-- 可选：高清图标（用于 Retina 屏幕） -->
        <link rel="icon" type="image/png" sizes="32x32" th:href="@{/images/favicon-32x32.png}">
        <link rel="icon" type="image/png" sizes="16x16" th:href="@{/images/favicon-16x16.png}">

        <!-- 可选：苹果设备图标（用于 iOS 主屏幕） -->
        <link rel="apple-touch-icon" th:href="@{/images/apple-touch-icon.png}" sizes="180x180">

        <link media="all" rel="stylesheet" th:href="@{/layui/css/layui.css}"/>
        <link media="all" rel="stylesheet" th:href="@{/css/index.css}"/>

    </th:block>

    <!--    引用layoi框架     -->
    <div th:fragment="menu">
        <div class="layui-layout layui-layout-admin">
            <div class="layui-header">
                <div class="layui-logo layui-hide-xs layui-bg-black">疫情数据展示</div>
                <!-- 头部区域（可配合layui 已有的水平导航） -->
                <ul class="layui-nav layui-layout-left">
                    <!-- 移动端显示 -->
                    <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
                        <i class="layui-icon layui-icon-spread-left"></i>
                    </li>

                    <li class="layui-nav-item layui-hide-xs"><a href="">nav 1</a></li>
                    <li class="layui-nav-item layui-hide-xs"><a href="">nav 2</a></li>
                    <li class="layui-nav-item layui-hide-xs"><a href="">nav 3</a></li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">nav groups</a>
                        <dl class="layui-nav-child">
                            <dd><a href="">menu 11</a></dd>
                            <dd><a href="">menu 22</a></dd>
                            <dd><a href="">menu 33</a></dd>
                        </dl>
                    </li>
                </ul>
                <ul class="layui-nav layui-layout-right">
                    <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                        <a href="javascript:;">
                            <img th:src="${session.user.img}" class="layui-nav-img">
                            <span th:text = "${session.user.username}"></span>
                        </a>
                        <dl class="layui-nav-child">
                            <dd><a href="">个人主页</a></dd>
                            <dd><a href="">设置中心</a></dd>
                            <dd><a th:href="@{/login/logout}">退出用户</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                        <a href="javascript:;">
                            <i class="layui-icon layui-icon-more-vertical"></i>
                        </a>
                    </li>
                </ul>
            </div>

            <div class="layui-side layui-bg-black">
                <div class="layui-side-scroll">
                    <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                    <ul class="layui-nav layui-nav-tree" lay-filter="test">
                        <li class="layui-nav-item layui-nav-itemed">
                            <a href="javascript:;">疫情数据可视化</a>
                            <dl class="layui-nav-child">
                                <dd><a href="/china">中国疫情地图</a></dd>
                                <dd><a href="/toPie">疫情饼图</a></dd>
                                <dd><a href="/toBar">疫情柱状图</a></dd>
                                <dd><a href="/toLine">疫情折线图</a></dd>
                                <dd><a href="/toGlobal">全球疫情地图</a></dd>
                            </dl>
                        </li>
                        <li class="layui-nav-item">
                            <a href="javascript:;">疫情数据管理</a>
                            <dl class="layui-nav-child">
                                <dd><a href="/china/toChinaManager">中国疫情数据管理</a></dd>
                                <dd><a href="javascript:;">list 2</a></dd>
                                <dd><a href="">超链接</a></dd>
                            </dl>
                        </li>
                        <li class="layui-nav-item">
                            <a href="javascript:;">健康打卡管理</a>
                            <dl class="layui-nav-child">
                                <dd><a href="/toHealthClock">健康打卡记录</a></dd>
                                <dd><a href="javascript:;">list 2</a></dd>
                                <dd><a href="">超链接</a></dd>
                            </dl>
                        </li>
                        <li class="layui-nav-item">
                            <a href="javascript:;">系统管理</a>
                            <dl class="layui-nav-child">
                                <dd><a href="/menu/toMenu">菜单管理</a></dd>
                                <dd><a href="javascript:;">list 2</a></dd>
                            </dl>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!-- 公共菜单的 JavaScript 代码片段 -->
    <div th:fragment="layuicommonscript">
        <script th:inline="javascript">
            //JS
            layui.use(['element', 'layer', 'util'], function(){
                var element = layui.element
                    ,layer = layui.layer
                    ,carousel = layui.carousel
                    ,util = layui.util
                    ,$ = layui.$;

                //头部事件
                util.event('lay-header-event', {
                    //左侧菜单事件
                    menuLeft: function(othis){
                        layer.msg('展开左侧菜单的操作', {icon: 0});
                    }
                    ,menuRight: function(){
                        layer.open({
                            type: 1
                            ,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                            ,area: ['260px', '100%']
                            ,offset: 'rt' //右上角
                            ,anim: 5
                            ,shadeClose: true
                        });
                    }
                });
                //轮播图
                //常规轮播
                carousel.render({
                    elem: '#test1'
                    ,arrow: 'always'
                    ,height: '450px'
                    ,width: '780px'
                });
            });
        </script>
    </div>

    <!-- 定义自定义模板 -->
    <div th:fragment="toolbarDemo">
        <script id="toolbarDemo" type="text/html">
            <div class="layui-btn-container">
                <button class="layui-icon layui-icon-add-1" lay-event="add">新增</button>
                <button class="layui-icon layui-icon-delete" lay-event="batchDelete">批量删除</button>
            </div>
        </script>
    </div>

</body>
</html>